<?php
$this->breadcrumbs=array(
	$this->module->id,
);
?>
<script language="javascript">
$(function(){

	$("#sys-info").css({"height":"120px","overflow":"hidden"});
	
	$("#sys-info-show").toggle(function(){
		$("#sys-info").css({"height":"auto"}).fadeIn('show');
		$(this).text("收起");
	},function(){
		$("#sys-info").css({"height":"120px","overflow":"hidden"});
		$(this).text("展开");
	});
	
	$("input[type=checkbox]").click(function(){
		alert($(this).val());
	});
	

	
	$(".achiveview").hover(function(){
		$(this).find(".achive-action").show();
	},function(){
		$(this).find(".achive-action").hide();
	});
});
function updateView(id){
	
	var url = '<?php echo $this->createUrl('comment/itemview');?>';

	url = url.replace(/<?php echo Yii::app()->urlManager->urlSuffix;?>/,'/id/'+id+'<?php echo Yii::app()->urlManager->urlSuffix;?>');

	
//	alert(url);
//	$.get(url,function(msg){
//		alert(msg);
//	});
	
	$("#reply-"+id).load(url);
}
function actionResourceIsComment(object){

	var id = object.attr("id");
	var ac = object.attr("name");

	//alert(id+'-'+ac);
	
	$.post('<?php echo $this->createUrl('comment/batchresource'); ?>',{'id':id,'ac':ac},function(data){
		//alert(data);

		updateView(id);

		if(data == 0){
		    $.msgbox({
		        height:100,
		        width:250,
		        content:{type:'alert', content: '修改成功！'},
		        animation:4,
		        onClose:function(){
					
		        }
		    });
		}	
	});

	
}
</script>


<div class="column1">

<div class="box">
	<?php $this->beginWidget('zii.widgets.CPortlet', array('title'=>Yii::t('admin','Statistics')));?>
			<div class="box-content">
				<!-- 
					<div class="column1">
						<ul>
							<li>已用空间：<?php echo UtilTools::formatSize($statistics->space->size);?></li>
							<li>目录：<?php echo $statistics->space->dircount;?></li>
							<li>文件：<?php echo $statistics->space->count;?></li>
							<li></li>
						</ul>
					</div>
				 -->
				 <div class="column1">
				 	<ul>
				 		<li>目录分类：<?php echo CHtml::link(Category::model()->count(),array('menu'));?> 个分类</li>
				 		<li>上传图片：<?php echo $statistics->gallery;?> 张图片</li>
				 		<li>上传视频：<?php echo $statistics->video;?> 个视频</li>
				 		<li>上传音频：<?php echo $statistics->audio;?> 个音乐文件</li>
				 	</ul>
				 </div>
				 <div class="column2" >
						<ul>
							<li>文章：<?php  echo CHtml::link($statistics->article->total,array('news/list'));?> 篇    | 回收站 (<?php echo CHtml::link($statistics->article->lock,array('news/list','state'=>Article::STATUS_TRASH));?>)</li>
							<li>页面：<?php $page = Article::model()->getNewsStatistics(Category::CONTENT_PAGE); echo CHtml::link($statistics->page->total,array('news/list','ctype'=>Category::CONTENT_PAGE));?> 个</li>
							<li>上传文件：<?php echo CHtml::link(File::model()->count(),array('category/create'));?> (共<?php echo UtilTools::formatSize($statistics->upload->size);?>)</li>
							<li></li>
						</ul>					
					</div>		
			
			</div>
			
	<?php $this->endWidget();?>
</div>

<div class="box">
	<?php $this->beginWidget('zii.widgets.CPortlet', array('title'=>Yii::t('admin','Comments')));?>
		<div class="box-content">
			<?php foreach ($comments as $data): ?>
				<?php $this->renderPartial('/comment/_list',array('data'=>$data));?>
			<?php endforeach;?>
			<hr class="space" />
		</div>	
	<?php $this->endWidget();?>
</div>

<div class="box">
	<?php $this->beginWidget('zii.widgets.CPortlet', array('title'=>Yii::t('admin','Achives')));?>
		<div class="box-content">
			<?php foreach ($achive as $data): ?>
				<?php $this->renderPartial('/info/_achiveview',array('data'=>$data));?>
			<?php endforeach;?>
		</div>	
	<?php $this->endWidget();?>
</div>


</div>
<div class="column2">
<div class="box">
	<?php $this->beginWidget('zii.widgets.CPortlet', array('title'=>Yii::t('admin','Recent Articles')));?>
 		<div class="box-content">
			<?php $this->widget('application.components.latest.Latest',array(
					'limit'=>5,
					'timeFormat'=>'Y-m-d h:i:s',
					'htmlOptions'=>array(
						'style'=>"text-align:center;"
					)
			));?> 		
 		</div>
	<?php $this->endWidget();?>
</div>	
<div class="box">
	<?php $this->beginWidget('zii.widgets.CPortlet', array('title'=>Yii::t('tag','Tags')));?>
 		<div class="box-content">
			<?php echo Tag::model()->generateTagsCloud();?>		
 		</div>
	<?php $this->endWidget();?>
</div>
<div class="box">
	<?php $this->beginWidget('zii.widgets.CPortlet', array('title'=>Yii::t('admin', 'System Information')));?>
 		<div class="box-content">
			<ul id="sys-info">
				<li>系统类型及版本号：<?php echo php_uname();?></li>
				<li>服务器解译引擎：<?php echo $_SERVER['SERVER_SOFTWARE'];?></li>
				<li>域名：<?php echo $_SERVER["HTTP_HOST"];?></li>
				<li>Zend 版本：<?php echo zend_version();?></li>
				<li>PHP安装路径：<?php echo DEFAULT_INCLUDE_PATH;?></li>
				<li>可用扩展：<?php var_dump(extension_loaded('id3'));?></li>
				<li>服务器IP：<?php echo gethostbyname($_SERVER['SERVER_NAME']);?></li>
				<li>接受请求的服务器IP：<?php echo $_SERVER['SERVER_ADDR'];?></li>
				<li>获取服务器Web端口：<?php echo $_SERVER['SERVER_PORT'];?></li>
				<li>客户端IP：<?php echo $_SERVER['REMOTE_ADDR'];?></li>
				<li>服务器CPU数量：<?php echo $_SERVER['PROCESSOR_IDENTIFIER'];?></li>
				<li>服务器系统目录：<?php echo $_SERVER['SystemRoot'];?></li>
				<li>服务器语言：<?php echo $_SERVER['HTTP_ACCEPT_LANGUAGE'];?></li>
				<li>当前文件绝对路径：<?php echo __FILE__;?></li>
			</ul>	
			<div style="text-align: right;"><a id="sys-info-show" href="javascript:void();">展开</a></div>	
			
 		</div>
	<?php $this->endWidget();?>
</div>
</div>


<?php $this->widget('ext.box.colorbox.colorboxWidget',array(
		'id'=>'td a',
		'options'=>'width:"95%", height:"95%", iframe:true'
))?>
